﻿using UnityEngine;
using System.Collections;

public class ObjectDestruction : MonoBehaviour {

	// Use this for initialization
	void Start () 
	{
	}
	
	// Update is called once per frame
	void Update () 
	{
		Vector2 screenPosition = Camera.main.WorldToScreenPoint(transform.position);
		if (screenPosition.y < -30)
		{
			Destroy(this.gameObject);
			WorldCreator.blocksOnScreen--;
		}

	}
}
